package com.bindapp.adapter;

import android.content.Context;
import android.graphics.Color;
import android.support.v4.content.ContextCompat;

import com.bindapp.R;
import com.bindapp.databinding.ItemBdviceItemBinding;
import com.bindapp.listener.RecyclerItemClick;

import java.util.List;

/**
 * Created by tom055 on 2018/7/22.
 */

public class BdeviceAdapter extends BaseRcAdapter {
    private String[] namelist=new String[]{"公共区海豚池","公共区贝壳池","VIP区海螺池"};
    private Context context;

    public BdeviceAdapter(Context context,List<Object> datas, int layoutId, int mVariableId, RecyclerItemClick listener) {
        super(datas, layoutId, mVariableId, listener);
        this.context=context;
    }

    @Override
    public void BinderHolder(BaseHolder holder, int position) {
        if(holder instanceof ContentHolder){
            ((ItemBdviceItemBinding)holder.getBinding()).label2.setText(namelist[position-1]);
            if(position!=1){
                ((ItemBdviceItemBinding)holder.getBinding()).label4.setText("绑定");
                ((ItemBdviceItemBinding)holder.getBinding()).label4.setTextColor(Color.WHITE);
                ((ItemBdviceItemBinding)holder.getBinding()).label4.setBackground(ContextCompat.getDrawable(context, R.drawable.round_blue));
            }

        }

    }
}
